<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core" 
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Etapas de Configura&ccedil;&atilde;o</title>
	<style type="text/css">
		.descricao{
		 	font-size:10px;
		 }
		.link{
			a:link {text-decoration: none; color: #ffffff}
			a:active {text-decoration: none; color: #ffffff}
			a:visited {text-decoration: none;color: #ffffff}
			a:hover {text-decoration: none;color: #ffffff}
		}
	</style>
</h:head>
<h:body>

	<table width="100%">
		<tr>
			<td><ui:include src="/index.xhtml" />
			</td>
		</tr>
	</table>	
	
	<h:form id="incluirUsuario" prependId="false">
	
		<table width="50%" align="center">
			<tr>
				<td><p:panel header="Etapas de Configura&ccedil;&atilde;o">	
				
						<p:dataList value="#{configuracaoEstabelecimentoMB.listEtapasConfiguracaoEstabelecimentos}" var="etapasConfiguracaoEstabelecimento" itemType="square">  
						    #{etapasConfiguracaoEstabelecimento.id} - #{etapasConfiguracaoEstabelecimento.descricao}  
						</p:dataList>  
						
						</p:panel>
						<p:panel header="Selecione o estabelecimento para visualizar as pend&ecirc;ncias: ">
						<br />	
							<h:outputText value=" "/>		
							<h:panelGrid columns="4" id="panelEtapasConf" border="0" style="align:center">
							
								<h:outputText id="textEstabelecimento" value="Estabelecimento: " />								 
								 
								 <h:selectOneMenu value="#{configuracaoEstabelecimentoMB.idSelectedEstabelecimento}" rendered="true" id="estabelecimento" immediate="true" >
								     <f:selectItem itemLabel="Selecione..." itemValue="0" noSelectionOption="true"/>			
									 <f:selectItems value="#{configuracaoEstabelecimentoMB.mapEstabelecimento}" var="estabelecimento" itemLabel="#{estabelecimento.nomeFantasia}" itemValue="{estabelecimento.id}" />
								 </h:selectOneMenu>  						
								
								
								<p:commandLink id="btnFind" update="tableGerencEtapaConfigEstab" action="#{configuracaoEstabelecimentoMB.findGerencEtapaConfigEstabPorIdEstabelecimento}" styleClass="link">
                    				<p:graphicImage value="/img/find.gif" width="20" height="20"/>
                    			</p:commandLink>	
                    			
                    			<p:commandLink id="btnAdd" action="#{estabelecimentoMB.etapa1}" styleClass="link">
                    				<p:graphicImage value="/img/botao_adicionar.gif" width="20" height="20"/>
                    			</p:commandLink>	
             					
							</h:panelGrid>
							
							<br /> <br />
							
						    <p:dataTable id="tableGerencEtapaConfigEstab" var="gerencEtapaConfigEstab" value="#{configuracaoEstabelecimentoMB.listGerencEtapaConfigEstab}" 		
						    			emptyMessage="N&atilde;o foram encontrados resultados">
				  
                 			<p:column headerText="N. da Etapa" styleClass="descricao">   
                 					#{gerencEtapaConfigEstab.etapaConfiguracao.numetapa}
                 			</p:column>
                 			
					        <p:column headerText="Estabelecimento" styleClass="descricao" filterOptions="#{gerencEtapaConfigEstab.estabelecimento.nomeFantasia}" filterMatchMode="exact">  
								<h:outputText value="#{gerencEtapaConfigEstab.estabelecimento.nomeFantasia}" />
					        </p:column>  		  
                 							
                 			<p:column headerText="Descri&ccedil;&atilde;o" styleClass="descricao">   
                 					#{gerencEtapaConfigEstab.etapaConfiguracao.descricao}
                 			</p:column>
                 			                 							  
                 			<p:column headerText="Status da Configura&ccedil;&atilde;o" styleClass="descricao" style="align:center"> 
                 						<h:panelGroup rendered="#{!gerencEtapaConfigEstab.etapaConcluida}" style="border:0px;align:center">
                 								<p:graphicImage value="/img/false.jpg" width="20" height="20"/>
                 						</h:panelGroup>
                 						<h:panelGroup rendered="#{gerencEtapaConfigEstab.etapaConcluida}" style="border:0px;align:center">
                 								<p:graphicImage value="/img/true.jpg" width="25" height="25" style="border:0px;align:center"/>
                 						</h:panelGroup>
							</p:column>	
								
							<p:column headerText="Configurar" styleClass="descricao"> 
								<h:panelGroup rendered="#{!gerencEtapaConfigEstab.etapaConcluida}">								
									
								    <h:panelGroup rendered="#{gerencEtapaConfigEstab.etapaConfiguracao.numetapa == 2}">
										<h:link  outcome="/pages/configuracaoFuncionamentoEstabelecimento.faces" styleClass="link" id="link2">
											<p:graphicImage value="/img/configuracao.png" width="25" height="25"/>
										</h:link>
									</h:panelGroup>
									
									<h:panelGroup rendered="#{gerencEtapaConfigEstab.etapaConfiguracao.numetapa == 3}">
										<h:link  outcome="/pages/novoServico.faces" styleClass="link" id="link3">
											<p:graphicImage value="/img/configuracao.png" width="25" height="25"/>
										</h:link>
									</h:panelGroup>								
								
									<h:panelGroup rendered="#{gerencEtapaConfigEstab.etapaConfiguracao.numetapa == 4}">
										<h:link  outcome="/pages/novoFuncionario.faces" styleClass="link" id="link4">
											<p:graphicImage value="/img/configuracao.png" width="25" height="25"/>
										</h:link>
									</h:panelGroup>
									
									<h:panelGroup rendered="#{gerencEtapaConfigEstab.etapaConfiguracao.numetapa == 5}">
										<h:link outcome="/pages/incluirServicosFuncionario.faces" styleClass="link" id="link5">
											<p:graphicImage value="/img/configuracao.png" width="25" height="25"/>
										</h:link>
									</h:panelGroup>									
								
								</h:panelGroup>
							
							</p:column>
														
					    </p:dataTable>  
					    
					    <table width="100%" >
						<tr>
							<td align="center">
								<h:commandButton value="Atualizar" update="tableGerencEtapaConfigEstab"  id="submitButton"
								             					actionListener="#{configuracaoEstabelecimentoMB.buscarGerencEtapaConfigEstabPorIdEstabelecimento}" />  	
							</td>
						</tr>
					</table>					    
					</p:panel>
				</td>
			</tr>
		</table>
	</h:form>
</h:body>
</html>